package com.example.demo.study;

import java.text.SimpleDateFormat;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.Date;

public class Study06 {
    public static void main(String[] args) {
        LocalDate date = LocalDate.now();
        System.out.println("今天的日期是：" + date);
        LocalDate nextWeek = LocalDate.of(date.getYear(), date.getMonth(), date.getDayOfMonth()+7);
        System.out.println("一周后的日期是：" + nextWeek);
        LocalDate tomorrow = date.plusDays(1);
        System.out.println("明天的日期是：" + tomorrow);
        LocalDateTime ldt = LocalDateTime.now();
        System.out.println("当前的时间是：" + ldt);
        Date data = new Date();
        System.out.println("当前的时间是：" + data);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
        System.out.println("当前的时间是：" + sdf.format(data));
    }
}
